public final class SIFGraphIO extends java.lang.Object implements GraphReader, GraphWriter
| Modifier and Type | Field and Description |
|---|---|
private java.lang.String |
defaultRelationship
Contains the String representation of the default relationship to use.
|
| Constructor and Description |
|---|
SIFGraphIO(java.lang.String defaultRelationship)
Constructs the SIFGraphIO object.
|
| Modifier and Type | Method and Description |
|---|---|
Graph |
parseGraph(java.io.File source,
boolean undirected)
Reads a graph from memory.
|
private static boolean |
testFile(java.io.File file)
Tests to see if a File is a valid graph file.
|
private java.lang.String |
verifyRelationship(java.lang.Object edgeData)
Verifies the relationship between edges.
|
void |
writeGraph(Graph toWrite)
Writes graphs to memory.
|
private final java.lang.String defaultRelationship
public SIFGraphIO(java.lang.String defaultRelationship)
defaultRelationship - the String representing the default edge
relationship.public Graph parseGraph(java.io.File source, boolean undirected)
parseGraph in interface GraphReadersource - the File object representing the graph in memory.undirected - This boolean is IGNORED as SIF graphs are NOT undirected.public void writeGraph(Graph toWrite)
writeGraph in interface GraphWritertoWrite - the Graph object to write to memory.private static boolean testFile(java.io.File file)
file - the File to test.private java.lang.String verifyRelationship(java.lang.Object edgeData)
Graph for representing an edge is a String. If it
not, the default relationship is used instead.edgeData -